# coding:utf-8

import serial
import os,sys

def recv_data():
    ser = serial.Serial('COM35', 115200, timeout=2)
    cout = 125 * 10
    with open(r'C:/11.txt', 'w') as f:
        while 1:
            s = ser.read(19)
            #print('{0}'.format(cout))
            if s:
                f.write(s.decode())
            cout = cout - 1
            if cout == 0:
                break

if __name__ == '__main__':
    recv_data()
